package org.freedoit.server.service.task;

import org.freedoit.common.data.FreeDoitTaskResponse;
import org.freedoit.server.service.ServiceManager;
import org.freedoit.common.shared.SharedTask;

public class DeleteTaskServlet extends AbstractTaskServletImpl {

	/**
	 * 
	 */
	private static final long serialVersionUID = 102304901720346460L;

	/**
	 * 
	 */
	protected void workOnTask(SharedTask sharedTask, Long currentUserId, Long currentClientId,
			FreeDoitTaskResponse result, Long timestamp) {
		// TODO Auto-generated method stub
		if (ServiceManager.deleteTask(sharedTask.getTaskId(), currentClientId, timestamp)) {
			result.setCode(FreeDoitTaskResponse.CODE_OK);
			result.setTimestamp(timestamp.longValue());
		} else {
			result.setCode(FreeDoitTaskResponse.CODE_INVALID_DATA);
		}
	}

}
